/**
 * 
 */
package com.wkr.test;
import java.util.Scanner;
/**
 *Copy Right Information		:
 *Project					:
 *JDK version used			:jdk1.8.0
 *Author					:WuKangrong
 *Version					:
 *Description				:����
 *Date						:2018.07.17
 **/

public class Demo1 {

	/**
	 * @param int, int, String
	 */
	static int int_i = 0;
	static int int_b = 2;
	static String String_c = "\r\n";
	
	
	/**   
	 * @Title: main   
	 * @Description: TODO(测试类)   
	 * @param: @param args      
	 * @return: void      
	 * @throws   
	 */
	public static void main(String[] args) {
		print();
	}
	
	
	
	static void draw()
	{
		for (int x_Int = 0; x_Int < 20; x_Int++) {
			for (int y_Int = 0; y_Int <= x_Int; y_Int++) {
				System.out.print("* ");
			}
			System.out.println();	
		}
	}
	static void print()
	{
		Scanner input = new Scanner(System.in);
		int in_Num = 0;
		System.out.println("请输入棱形的行数(输入偶数棱形输出不完整)：");
		in_Num = input.nextInt();
		drawStar(in_Num);
	}
	static void drawStar(int in_Num)
	{
		int in_Number = in_Num;
		int star_Mid = in_Number / 2 + 1;
		int star_Begin = star_Mid;
		int star_End = star_Mid;
		int move_Flag = 0;
		
		for(int x_Int = 1; x_Int <= in_Number; x_Int++) {
			for(int y_Int = 1; y_Int <= in_Number; y_Int++) {
				if(x_Int <= star_Mid) {
					if(y_Int == star_Begin ){
						move_Flag = star_Begin;
						while(move_Flag <= star_End) {
							System.out.print("*");
							move_Flag++;
						}
						star_Begin--;
						star_End++;
						if(x_Int == star_Mid) {
							star_Begin += 2;
							star_End -= 2;
						}
						break;
					}else {
						System.out.print(" ");
					}
				}else {
					if (y_Int == star_Begin){
						move_Flag = star_Begin;
						while (move_Flag <= star_End) {
							System.out.print("*");
							move_Flag++;
						}
						star_Begin++;
						star_End--;
						break;
					}else {
						System.out.print(" ");
					}
				}
			}
			System.out.println();
		}
	}
	
}
